package jp.bgbt.fles.app.utils;

import android.content.Context;
import android.location.LocationManager;

import jp.bgbt.fles.app.MainApplication;

public class AppUtils {

    // gps是否可用
    public static boolean isLocationEnable() {
        Context context = MainApplication.getInstance();
        LocationManager locationManager
                = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
        boolean gps = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
        boolean network = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
        if (gps || network) {
            return true;
        }
        return false;
    }

}
